package com.sy.vo;

import lombok.Data;

/**
 * @author maojq
 * @date 2020/11/24 0024 16:19
 */
@Data
public class R {
    private int code;
    private String msg;
    private Object data;

    public R() {
    }

    public R(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static R ok() {
        return new R(100, "OK", null);
    }

    public static R ok(Object data) {
        return new R(100, "OK", data);
    }

    public static R fail() {
        return new R(101, "fail", null);
    }

    public static R fail(String msg) {
        return new R(101, msg, null);
    }

    public static R ok(String msg) {
        return new R(100, msg, null);
    }
}
